package rmi;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class Client01 {
    private Client01() {}

    public static void main(String[] args) {

        String host = (args.length < 1) ? "141.22.85.239" : args[0];
        try {
            Registry registry = LocateRegistry.getRegistry(host,1098);
            IServer01 stub = (IServer01) registry.lookup("Server01");
            String response = stub.answer();
            System.out.println("Antwort von Server01: " + response);
        } catch (Exception e) {
            System.err.println("Client exception: " + e.toString());
            e.printStackTrace();
        }
    }

}
